﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows;
using PowersourceUIToolkit;
using UCL.Powersource;
using UCL.Powersource.Mock;
using UCL.Powersource.TFS;

namespace Powersource.TestApp
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        DummyPowersourceBootStrapper bs;
        List<Assembly> Assemblies;
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            bs = new DummyPowersourceBootStrapper();
            bs.DefaultInterfaceImplementationTypes.Add(typeof(IAnalysisBridge), typeof(AnalysisBridge));
            bs.TypesToLoad = new Type[] { typeof(UCL.Powersource.ViewModels.PowersourceMainViewModel), typeof(UCL.Powersource.Analysis.ReportingContext), typeof(DummyPackageConfiguration), typeof(UCL.Powersource.Analysis.StatisticTeamBase), typeof(UCL.Powersource.Statistics.NumberOfMethodsStats), typeof(UCL.Powersource.Analysis.StatisticTeamBase) };
            bs.UIManager = new PowersourceUIToolkit.UIManager();
            bs.TfsTeamProjectCollectionFactory = new TfsTeamProjectCollectionFactoryAdapter();
            bs.PackageConfigurationFactory = new PackageConfigurationFactory();
            bs.StatisticManager = new StatisticManager();
            bs.ReportingManager = new ReportingManager();
            bs.StatisticManagerQueue = new StatisticManagerQueue();
            bs.RemoteBuilderQueue = new RemoteBuilderQueue();
            //bs.StatisticManagerQueue = StatisticManagerQueue.Default;
            //bs.RemoteBuilderQueue = new RemoteBuilderQueue();

            bs.IVsEnv = new DummyVSEnv() { Uri = "http://81.2.210.131:8080/tfs/TestProjectCollection1/" };

            bs.Initialize();
        }

        protected override void OnExit(ExitEventArgs e)
        {
            base.OnExit(e);
        }
    }
}
